﻿#define _CRT_SECURE_NO_WARNINGS 1

//编程初学者入门训练第五十一题
//BC53 计算一元二次方程
//https://www.nowcoder.com/practice/7da524bb452441b2af7e64545c38dc26?tpId=107&tqId=33334&rp=1&ru=/exam/oj/ta&qru=/exam/oj/ta&sourceUrl=%2Fexam%2Foj%2Fta%3FtpId%3D107&difficulty=undefined&judgeStatus=undefined&tags=&title=

#include <stdio.h>
#include <math.h>
int main() {
    float a = 0;
    float b = 0;
    float c = 0;
    while (scanf("%f %f %f", &a, &b, &c) != EOF) {
        if (a == 0) {
            printf("Not quadratic equation\n");
        }
        else {
            float delta = (b * b) - 4.0 * a * c;
            double x1 = (-b + sqrt(delta)) / 2.0 / a;
            double x2 = (-b - sqrt(delta)) / 2.0 / a;
            if (delta == 0)
            {
                if (x1 == 0)
                    printf("x1=x2=0.00");
                else
                    printf("x1=x2=%.2f\n", x1);
            }
            else if (delta > 0) {
                if (x1 <= x2) {
                    printf("x1=%.2f;x2=%.2f\n", x1, x2);
                }
                else {
                    printf("x1=%.2f;x2=%.2f\n", x2, x1);
                }
            }
            else if (delta < 0) {
                printf("x1=%.2f-%.2fi;x2=%.2f+%.2fi", -b / 2 / a, sqrt(-delta) / 2 / a,
                    -b / 2 / a, sqrt(-delta) / 2 / a);
            }
        }
    }
    return 0;
}